{inc:header.htm}
<div class="m">
	<div class="p">
		<form id="user_set" action="index.php?u=user-{$_GET['action']}-ajax-1" method="post">
		<input name="uid" type="hidden" value="{$data[uid]}" />
		<div class="cc contadd">
			<table><tr valign="top">
				<td><table class="tb tl">
					<tr>
						<th class="th"><div style="width:65px"><b>*</b>群组</div></th>
						<td class="col">
							{$gidhtml}
						</td>
					</tr>
					<tr>
						<th class="th"><b>*</b>用户名</th>
						<td class="col"><input name="username" type="text" value="{$data[username]}" class="inp w1" /></td>
					</tr>
					<tr>
						<th class="th"><b>*</b>密码</th>
						<td class="col"><input name="password" type="password" value="{$data[password]}" class="inp w1" /></td>
					</tr>
					<tr>
						<th class="th">Email</th>
						<td class="col"><input name="email" type="email" value="{$data[email]}" class="inp w1" /></td>
					</tr>
					<tr>
						<th class="th">个人主页</th>
						<td class="col"><input name="homepage" type="text" value="{$data[homepage]}" class="inp w1" /></td>
					</tr>
					<tr>
						<th class="th">个人简介</th>
						<td class="col">
							<textarea name="intro" class="inp w98" style="height:60px" placeholder="写点什么？" maxlength="255">{$data[intro]}</textarea>
						</td>
					</tr>
					<tr>
						<th class="th"></th>
						<td class="col"><input type="submit" value="&#20445;&#23384;" class="but1" style="margin:0" /></td>
					</tr>
				</table>
				</td>
			</tr>
			</table>
		</div>
		</form>
	</div>
</div>

<script type="text/javascript">
// 自动保存
var action = "{$_GET['action']}";
window.autoSave = function() {
	if(action != "add") return;
	var data = $("#user_set").serialize();
	twAjax.post("index.php?u=user-auto_save-ajax-1", data, function(html) { });
};

// 触发自动保存
$("#user_set input, #user_set textarea, #user_set select").change(autoSave);

// 提交表单
twAjax.submit("#user_set", function(data){
	twAjax.alert(data);
	if(window.twData.err==0) {
		setTimeout(function(){
			var i = P("#box_tab ul li[urlKey='user-index']").index();
			if(i != -1) parent.ifrRefresh(i);
			parent.oneTab("user-index");

			var j = P("#box_tab ul li[urlKey='"+urlKey+"']").index();
			parent.rmTab(j);
		}, 1200);
	}
});
</script>

{hook:admin_content_add_after.htm}

</body>
</html>
